package ru.paswd.marketprice.rest.receipt.getter.stub;

import org.springframework.stereotype.Component;
import ru.paswd.marketprice.rest.receipt.getter.api.ReceiptGetter;
import ru.paswd.marketprice.rest.receipt.getter.api.dto.Company;
import ru.paswd.marketprice.rest.receipt.getter.api.dto.FiscalId;
import ru.paswd.marketprice.rest.receipt.getter.api.dto.Receipt;
import ru.paswd.marketprice.rest.receipt.getter.api.dto.ReceiptItem;

import java.time.OffsetDateTime;
import java.time.ZoneOffset;
import java.util.Collections;

@Component
public class StubReceiptGetter implements ReceiptGetter {
    @Override
    public Receipt get(String fiscalNumber, String fiscalSign, String fiscalDocumentNumber) {
        return Receipt.builder()
                .fiscalId(FiscalId.builder()
                        .number(fiscalNumber)
                        .sign(fiscalSign)
                        .documentNumber(fiscalDocumentNumber)
                        .build())
                .company(Company.builder()
                        .name("Агроторг ООО")
                        .address("620017, г. Екатеринбург, ул. Азина, д. 18ж")
                        .build())
                .dateTime(OffsetDateTime.of(2018, 5, 17, 17, 57, 0, 0, ZoneOffset.ofHours(3)))
                .totalSum(5800)
                .items(Collections.singletonList(
                        ReceiptItem.builder()
                                .name("*3492277 NEST.Мор.MAXIB.СТРАЧАТЕЛ.140мл")
                                .price(3900)
                                .quantity(2f)
                                .sum(5800)
                                .build()
                ))
                .build();
    }
}
